package jtk.project4.fleet.ibatis.dao;

import java.sql.SQLException;
import java.util.List;


import jtk.project4.fleet.domain.Employees;

public class EmployeesDao extends IbatisDao{
	
	public List selectEmployeess() throws SQLException {
	List selectEmployeess = null;
		selectEmployeess =getSqlMap().queryForList("SELECT_ALL_EMPLOYEES", null);
		return selectEmployeess;
	}

	public int deleteEmployees(Employees employees) throws SQLException{
		return (int) getSqlMap().delete("DELETE_EMPLOYEES", employees);
	}
	
	public int updateEmployees(Employees employees) throws SQLException{
		return (int) getSqlMap().update("UPDATE_EMPLOYEES", employees);
	}
	
	public Employees insertEmployees(Employees employees) throws SQLException{
		return (Employees) getSqlMap().insert("INSERT_EMPLOYEES", employees);
	}
	
	public List selectEnployeesType() throws SQLException {
		return getSqlMap().queryForList("SELECT_ALL_EMPLOYEES_TYPE", null);
	}
	
		
	public static void main (String args[]) throws SQLException{
		Employees employees;
		employees = new Employees();
		employees.setEmployeeId(281);
		employees.setCatId(100);
		
		new EmployeesDao().insertEmployees(employees);
		//new EmployeesDao().deleteEmployees(employees);
		//new EmployeesDao().updateEmployees(employees);
		}

//	public void insertEmployeesType(Employees employees) {
//		// TODO Auto-generated method stub
//		
//	}

}
